Image processing device

ABSTRACT

An image processing device may judge whether to execute a first type of enlarging process or a second type of enlarging process based on M lines of letter strings in an original image, in a case of judging to execute the first type of enlarging process, generate a first type of processed image data indicating a first type of processed image by executing the first type of enlarging process, and in a case of judging to execute the second type of enlarging process, generate a second type of processed image data indicating a second type of processed image by executing the second type of enlarging process. A layout of the plurality of letters in the second type of processed image is different from a layout of the plurality of letters in the first type of processed image.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation application of U.S. Ser. No.14/640,483 filed on Mar. 6, 2015 and claims priority to Japanese PatentApplication No. 2014-044339, filed on Mar. 6, 2014, the contents of eachof which are hereby incorporated by reference into the presentapplication.

TECHNICAL FIELD

The specification discloses an image processing device that executes animage processing on original image data indicating an original imageincluding a plurality of letters to generate processed image dataindicating a processed image including the plurality of letters.

BACKGROUND

an image forming system including a DFE processor (abbreviation ofDigital Front End Processor) device, a BEP (abbreviation of Back EndProcessor) device, and an image forming device is known. When image datais inputted from the DFE processor device, the BEP device enlargesletters in a letter region included in the image data, and generatesimage data of the letter region including the enlarged letters.

SUMMARY

Conventionally, letters in a letter region were enlarged normally usingone method, and enlarging them by using different methods had not beenconsidered at all.

The description provides a technique to suitably enlarge a plurality ofletters included in image data.

An image processing device disclosed herein may comprise: one or moreprocessors; and a memory storing computer readable instructions. Thecomputer readable instructions, when executed by the one or moreprocessors, may cause the image processing device to: acquire originalimage data indicating an original image, the original image including Mlines of letter strings (the M being an integer of 1 or more) configuredof a plurality of letters; and generate processed image data indicatinga processed image by executing image processing on the original imagedata, the processed image having the plurality of letters expressed inan enlarged manner as compared to the original image. The imageprocessing may include: judging whether to execute a first type ofenlarging process or execute a second type of enlarging process based onthe M lines of letter strings in the original image; in a case ofjudging to execute the first type of enlarging process, generating afirst type of processed image data indicating a first type of processedimage by executing the first type of enlarging process; and in a case ofjudging to execute the second type of enlarging process, generating asecond type of processed image data indicating a second type ofprocessed image by executing the second type of enlarging process. Alayout of the plurality of letters in the first type of processed imagemay be equal to a layout of the plurality of letters in the originalimage, and the first type of processed image may include M lines ofenlarged letter strings in which the plurality of letters is expressedin the enlarged manner, and a layout of the plurality of letters in thesecond type of processed image may be different from the layout of theplurality of letters in the original image, and the second type ofprocessed image may include N lines of enlarged letter strings (the Nbeing an integer of 1 or more) in which the plurality of letters isexpressed in the enlarged manner.

Moreover, an image processing method executed by the image processingdevice, a computer program and a non-transitory computer-readablestorage medium which stores the computer-readable instructions, forachieving the above image processing device, are also new and useful.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 shows a configuration of a communication system;

FIG. 2 shows a flowchart of a process by an image processing server;

FIG. 3 shows a flowchart of the process continued from FIG. 2 by theimage processing server;

FIG. 4 shows a flowchart of a letter string analyzing process;

FIG. 5 shows an explanatory diagram for explaining a case that satisfiesa simple enlargement condition of a first embodiment;

FIG. 6 shows a flowchart of a coupling process;

FIG. 7 shows a flowchart of a target region determining process;

FIG. 8 shows an explanatory diagram for explaining a region enlargingprocess;

FIG. 9 shows a flowchart of a rearranging process;

FIG. 10 shows a flowchart of a line number determining process;

FIG. 11 shows an explanatory diagram for explaining a case A in whichrespective letters are rearranged and enlarged;

FIG. 12 shows an explanatory diagram for explaining a case B in whichrespective letters are rearranged and enlarged;

FIG. 13 shows an explanatory diagram for explaining a case satisfying asimple enlargement condition of a second embodiment;

FIG. 14 shows an explanatory diagram for explaining a case satisfying asimple enlargement condition of a third embodiment;

FIG. 15 shows an explanatory diagram for explaining a case satisfying asimple enlargement condition of a fourth embodiment;

FIG. 16 shows an explanatory diagram for explaining a case satisfying asimple enlargement condition of a fifth embodiment;

FIG. 17 shows an explanatory diagram for explaining a case satisfying asimple enlargement condition of a sixth embodiment;

FIG. 18 shows an explanatory diagram for explaining a case satisfying asimple enlargement condition of a first variant; and

FIG. 19 shows an explanatory diagram for explaining a case satisfyingthe simple enlargement condition of the fourth embodiment.

DETAILED DESCRIPTION First Embodiment (Configuration of CommunicationSystem 2)

As shown in FIG. 1, a communication system 2 includes a multi functionperipheral 10 (which may be denoted as ‘MFP 10’) and an image processingserver 50. The multi function peripheral 10 and the image processingserver 50 are configured communicable with each other via the Internet4. The multi function peripheral 10 is a peripheral device that iscapable of executing multiple functions including print function, scanfunction, copy function, FAX function, and the like (i.e., it is aperipheral device for a PC (Personal Computer) that is not shown). Theimage processing server 50 is a server provided on the Internet 4 by avendor or manufacturer of the multi function peripheral 10.

(Overview of Processes Executed by Multi Function Peripheral 10)

The copy function that the multi function peripheral 10 can execute isclassified into a monochrome copy function and a color copy function,and the description of the present embodiment will be given by focusingon the color copy function. The color copy function is classified into anormal color copy function and a letter-enlarging color copy function.In both cases where an execution instruction provided from a user is forthe normal color copy function or the letter-enlarging color copyfunction, the multi function peripheral 10 firstly color scans a sheetshowing an image that is a scan target (hereafter referred to as ‘scantarget sheet’), and creates scan image data SID. The scan image data SIDis RGB bit map data in multilevel (e.g., grayscale of 256 levels).

A scan image SI indicated by the scan image data SID (that is, the imageshown on the scan target sheet) has a white background, one text objectTOB, and two picture objects OB1, OB2. The text object TOB includes aletter string including three lines configured of a plurality of blackletters “A to M”. The color of the letters may be a color different fromblack (e.g., red). The picture objects OB1, OB2 do not include letters,but include pictures configured of a plurality of colors.

Hereinbelow, a plurality of scan images SI, SI2 to SI6 (see FIG. 5 andFIGS. 13 to 17) with different letter strings included in the textobject TOB will be exemplified. The scan images SI, SI2 to SI6 areindicated by scan image data that are RGB bit map data in multilevel(e.g., grayscale of 256 levels), similar to the scan image SI.

Further, in each drawing of the present embodiment, the letter stringsconfiguring the respective text objects TOB are expressed by alphabets“A to M” arranged in a regular order, however, in actuality the letterstrings configure a part of or an entirety of a sentence. In each letterstring (i.e., one line of letter string), the sentence progresses from aleft side toward a right side laterally within the scan image SI.Further, in three lines of letter strings “A to M”, the sentenceprogresses from an upper side toward a lower side vertically within thescan image SI. In all of the images below (for example, a processedimage PI), a direction along which a plurality of letters configuringone line of letter string is arranged, and a direction verticallyintersecting the aforementioned direction are called a “horizontaldirection” and a “vertical direction”, respectively. Further, since thesentence progresses from the left side toward the right side, a left endand a right end in the horizontal direction are respectively called a“fore end” and a “rear end”.

In a case where the execution instruction for the normal color copyfunction is provided from the user, the multi function peripheral 10uses the scan image data SID to print the image on a sheet (hereinbelowreferred to as ‘print target sheet’) in accordance with a copymagnification set by the user. For example, when no magnification is set(when the copy magnification is equal to an original size), the multifunction peripheral 10 prints an image having the same size as the imageshown on the scan target sheet on the print target sheet. Further, forexample, when the copy magnification is a value indicating enlargementof the image, the multi function peripheral 10 prints an image having asize larger than the image shown on the scan target sheet on the printtarget sheet. In this case, for example, the image shown on the A4-sizedscan target sheet is enlarged, and is printed on an A3-sized printtarget sheet. As a result, an image in which all of the three objectsTOB, OB1, OB2 are shown by being enlarged is printed on the print targetsheet.

On the other hand, in a case where the execution instruction for theletter-enlarging color copy function is provided from the user, themulti function peripheral 10 sends the scan image data SID to the imageprocessing server 50 via the Internet 4. Due to this, the multi functionperipheral 10 receives processed image data PID from the imageprocessing server 50 via the Internet 4, and prints a processed image PIindicated by the processed image data PID on the print target sheet.Specifically, the multi function peripheral 10 prints the processedimage PI having the same size as the scan target sheet (e.g., A4 size)on the print target sheet.

As in FIG. 1, in the processed image PI as compared to the scan imageSI, the picture objects OB1, OB2 are not enlarged, but the text objectTOB is expressed by being enlarged. Thus, even if the size of theletters in the scan image SI is small, the processed image PI can makethe size of the letters large, whereby the user can easily see theletters in the processed image PI. That is, in the letter-enlargingcolor copy function, only the letters are enlarged on the premise ofobtaining images of the same size, instead of generating processed imagedata corresponding to an image with a size different from the scanimage, as in the normal color copy function.

(Configuration of Image Processing Server 50)

The image processing server 50 executes image processing on the scanimage data SID received from the multi function peripheral 10 togenerate the processed image data PID, and sends the processed imagedata PID to the multi function peripheral 10. The image processingserver 50 includes a network interface 52 (interface herein may bedenoted as ‘I/F’), and a controller 60. The network interface 52 isconnected to the Internet 4. The controller 60 includes a CPU 62 and amemory 64. The CPU 62 is a processor that executes various processes(i.e., processes as shown in FIG. 2, etc.) in accordance with program 66stored in the memory 64.

(Processes Executed by Image Processing Server 50; FIG. 2)

Next, by referring to FIG. 2, contents of processes executed by the CPU62 of the image processing server 50 will be described. The CPU 62activates the process of FIG. 2 in a case where the scan image data SIDis received from the multi function peripheral 10 via the Internet 4.

In S100, the CPU 62 executes a letter string analyzing process (see FIG.4 described later) to determine a text object region (hereafter simplydenoted ‘text region’) TOA including three lines of letter strings “A toM” in the scan image SI. Then, the CPU 62 determines three band-shapedregions LA1 to LA3 including three lines of letter strings in the textregion TOA.

In S200, the CPU 62 executes a blank space region determining process todetermine a blank space region BA within the scan image SI. The blankspace region BA encompasses the text region TOA, and has a size (i.e.,area) larger than a size of the text region TOA. The CPU 62 determines ablank space region BA that does not overlap with other objects (e.g.,picture objects OA1, OA2) in accordance with a size of a blank spacearound the text region TOA. For example, in the scan image SI, sincethere is a large blank space to the right and below the text region TOA,a blank space region BA having a rectangular shape that extends downwardand rightward from the text region TOA is hereby determined. An aspectratio of the blank space region BA normally differs from an aspect ratioof the text region TOA. The blank space region BA in the scan image SIincludes a target region TA (see processed image PI in S800) in theprocessed image PI. The process of S200 is equivalent to a process ofdetermining a range that allows maximum enlargement of the text regionTOA in the processed image PI. Notably, the target region TA in theprocessed image PI described later is a region in which the letterstrings “A to M”, shown by being enlarged, are supposed to be arranged.

In S300, the CPU 62 judges whether or not the text object TOB includedin the scan image SI satisfies a simple enlargement condition.Specifically, the CPU 62 judges that the simple enlargement condition issatisfied in judging that the text object TOB include only one line ofletter string, and judges that the simple enlargement condition is notsatisfied in judging that the text object TOB include two or more linesof letter strings. Aside from the simple enlargement condition used inthe first embodiment (i.e., “letter string=1 line?”), FIG. 2 alsodescribes contents of simple enlargement conditions used in second tosixth embodiments.

In S300, in a case of judging that the simple enlargement condition issatisfied (YES to S300), the CPU 62 executes a simple enlargementprocess (see FIG. 5 described later) in S400 to generate the processedimage data PID. On the other hand, in a case of judging that the simpleenlargement condition is not satisfied (NO to S300), the CPU 62 proceedsto S500 of FIG. 3.

In S500, the CPU 62 executes a coupling process (see FIG. 6 describedlater) to generate coupled image data indicating one coupled image CI.The coupled image CI includes one line of letter string “A to M”, inwhich the three lines of letter strings included in three band-shapedregions LA1 to LA3 are linearly coupled (i.e., joined) in the horizontaldirection.

In S600, the CPU 62 executes a target region determining process (seeFIG. 7 described later) to determine the target region TA in the scanimage SI (see rearranged image RI in S700). The target region TA in thescan image SI matches a target region TA in the processed image PI (seeprocessed image PI in S800). Thus, the process of S600 is equivalent toa process of determining the target region TA in the processed image PI.

In S700, the CPU 62 executes a rearranging process (see FIG. 9 describedlater). The CPU 62 generates rearranged image data indicating arearranged image RI by determining the rearranged region RA, andrearranging the plurality of letters “A to M” within the rearrangedregion RA by using the coupled image data indicating the coupled imageCI.

In S800, the CPU 62 executes an enlarging process (see FIG. 11 and FIG.12 described later). Enlarged image data is generated by enlarging therearranged image data indicating the rearranged image RI to the targetregion TA. Then, the CPU 62 uses the enlarged image data to generate theprocessed image data PID indicating the processed image PI. Therespective letters are shown by being enlarged in the processed imagePI, however, the processed image data PID has a same number of pixels asthe scan image data SID.

In S900, the CPU 62 sends the processed image data PID to the multifunction peripheral 10 via the Internet 4. Due to this, the processedimage PI indicated by the processed image data PID is printed on theprint target sheet.

(Letter String Analyzing Process; FIG. 4)

Next, by referring to FIG. 4, the contents of the letter stringanalyzing process executed in S100 of FIG. 2 will be described. In S110,the CPU 62 executes a binarizing process on the scan image data SID togenerate binary data BD (only a part of which is shown in FIG. 4) havingthe same number of pixels as the scan image data SID. Specifically, theCPU 62 firstly determines a background color of the scan image SI (whichis white in the present embodiment) by using the scan image data SID.Specifically, the CPU 62 generates a histogram showing a distribution offrequencies of pixel values of a plurality of pixels in the scan imagedata SID. Then, the CPU 62 uses the histogram to specify the pixel valuewith a maximum frequency (which is hereafter denoted ‘most frequentpixel value to determine the background color. Note, the “frequency”means how often the pixel value appears. Next, for each of the pluralityof pixels in the scan image data SID, the CPU 62 allots “0” as the pixelvalue of the pixel in the in the scan image data SID existing at aposition corresponding to a pixel in a case where the pixel value of thepixel matches the most frequent pixel value, and allots “1” as the pixelvalue of the pixel in the in the scan image data SID existing at aposition corresponding to a pixel in a case where the pixel value of thepixel does not match the most frequent pixel value. As a result, thebinary data BD configured of pixels having the pixel values of “0” and“1” corresponding to the scan image data SID is generated. In the binarydata BD, each of the pixels indicating each letter (e.g., “A”, “B”)included in the text object TOB indicates the pixel value “1”, each ofthe pixels indicating each picture object OB1, OB2 indicates the pixelvalue “1”, and pixels other than the aforementioned (i.e., pixelsindicating the background) indicate the pixel value “0”. Hereinbelow,the pixel indicating the pixel value “1” and the pixel indicating thepixel value “0” in the binary data BD are respectively called “ON pixel”and “OFF pixel”.

In S120, the CPU 62 executes a labelling process on the binary data BDgenerated in S110 to generate labeled data LD (only a part of which isshown in FIG. 4) having a same number of pixels as the binary data BD.Specifically, the CPU 62 divides the plurality of ON pixels in thebinary data BD into one or more ON pixel groups, and allots differentpixel values (e.g., “1”, “2”, etc.) to each of the one or more ON pixelgroups. Each ON pixel group is configured of one or more ON pixels beingadjacent one another. That is, in a case where one or more ON pixels areincluded in eight adjacent pixels that are adjacent to the one ON pixelbeing the target of the labelling process, the CPU 62 classifies thetargeted one ON pixel and the one or more ON pixels included in theeight adjacent pixels as being of the same ON pixel group (i.e., groupsaccordingly). The CPU 62 determines the one or more ON pixel groups bysequentially executing the grouping of the respective ON pixels whilechanging the ON pixel being the target of the labelling process. Forexample, in the labeled data LD of FIG. 4, the pixel value “1” isallotted to the respective ON pixels indicating the letter “A” (i.e., toone ON pixel group), and the pixel value “2” is allotted to therespective ON pixels indicating the letter “B” (i.e., to another ONpixel group).

In S130, the CPU 62 determines each unit region corresponding to each ofthe ON pixel groups by using the labeled data LD generated in S120. Eachof the unit regions is a rectangular region that circumscribes thecorresponding one ON pixel group. In the case of using the labeled dataLD in FIG. 4, for example, the CPU 62 determines a unit region RE1circumscribing the ON pixel group allotted with the pixel value “1”(i.e., a unit region corresponding to the letter “A”) and a unit regionRE2 circumscribing the ON pixel group allotted with the pixel value “2”(i.e., a unit region corresponding to the letter “B”). Morespecifically, the CPU 62 determines fifteen unit regions, namelythirteen unit regions corresponding to the thirteen letters “A” to “M”,two unit regions corresponding to the two picture objects OB1, OB2, fromamong the scan image SI. The determination of a unit region is executedby storing positions of respective pixels configuring apexes of the unitregion in the memory 64. However, hereinbelow, in the descriptionrelated to “determination of region (or position)”, description onstoring the position of the pixel in the memory 64 will be omitted.

In S140, the CPU 62 determines a plurality of object regions in the scanimage SI using the fifteen unit regions determined in S130.Specifically, the CPU 62 classifies the fifteen unit regions into aplurality of unit region groups, and determines each of object regionscorresponding to each unit region group. One unit region group isconfigured of one or more unit regions existing close to each other. Ina case where a distance between two unit regions (i.e., number ofpixels) is less than a predetermined distance, the CPU 62 classifies thetwo unit regions in the same unit region group. The predetermineddistance is set in advance according to resolution of the scan imagedata SID. For example, in the present embodiment, the scan image dataSID has the resolution of 300 dpi, and the predetermined distancecorresponding to the resolution of 300 dpi is 10 pixels. Further, in thelabeled data LD in FIG. 4, a distance between the unit region RE1corresponding to the letter “A” and the unit region RE2 corresponding tothe letter “B” is 3 pixels. Thus, the CPU 62 classifies the unit regionRE1 and the unit region RE2 in the same unit region group. Due to this,the CPU 62 can group the letters existing close to each other, that is,the letters configuring the same sentence. More specifically, the CPU 62determines three unit region groups for the scan image SI, namely a unitregion group including thirteen unit regions corresponding to thethirteen letters “A” to “M” in the text object TOB, a unit region groupincluding the unit region corresponding to the picture object OB1, and aunit region group including the unit region corresponding to the pictureobject OB2. Then, the CPU 62 determines a rectangular region thatcircumscribes the unit region group as the object region, for each ofthe three unit region groups. That is, the CPU 62 determines a regionthat contains the pixel arranged at a same positon as the image includedin each of the object regions determined using the labeled data LD, fromamong the scan image data SID, respectively as each of the three objectregions, namely the object region TOA including the thirteen letters “A”to “M” in the text object TOB, the object region OA1 including thepicture object OB1, and the object region OA2 including the pictureobject OB2.

In S150, the CPU 62 determines a type of the object region for each ofthe three object regions TOA, OA1, OA2 determined in S140. Specifically,the CPU 62 judges whether or not each of the object regions TOA, OA1,OA2 is a text region containing letters. The CPU 62 firstly generates ahistogram showing a distribution of frequency of pixel values of aplurality of pixels configuring partial image data indicating the objectregion TOA among the scan image data SID. Then, the CPU 62 uses thehistogram to calculate a number of pixel values of which frequency isgreater than zero (i.e., number of colors used in the object regionTOA). The CPU 62 judges that the object region OA1 is a text region in acase where the calculated value is less than a predetermined number(e.g., “1.0”), and judges that the object region OA1 is not a textregion in a case where the calculated value is equal to or more than thepredetermined number. The object region TOA of the present embodimentincludes black letters “A” to “M” and white background. Accordingly, inthe histogram corresponding to the object region TOA, normally,frequencies of only two pixel values including the pixel valueindicating black color and the pixel value indicating white color arelarger than zero. Thus, the CPU 62 judges that the object region TOA isa text region. On the other hand, for example, in the picture objectOA1, normally, 10 or more colors are used. Thus, in the histogramcorresponding to the object region OA1, normally, the number of pixelvalues of which frequencies are larger than zero adds up to be equal toor more than the predetermined number. Thus, the CPU 62 judges that theobject region OA1 is not a text region but a picture object region.Similarly, the CPU 62 judges that the object region OA2 is a pictureobject region by using the histogram corresponding to the object regionOA2.

In S160, the CPU 62 executes a band-shaped regions determining processon the one text region TOA determined in S150. However, the CPU 62 doesnot execute the band-shaped regions determining process on the pictureobject regions OA1, OA2. Specifically, the CPU 62 firstly generates aprojected histogram corresponding to the text region TOA. The projectedhistogram shows a distribution of frequency of the ON pixels (i.e.,pixels indicating “1”) in a case of projecting each pixel representingthe text region TOA in a horizontal direction, among the plurality ofpixels configuring the binary data BD (see S110). In other words, theprojected histogram shows a distribution of frequency of letters in acase of projecting each pixel representing the text region TOA of thescan image data SID in the horizontal direction. In the projectedhistogram, one line of letter string is shown by a range in whichfrequency is greater than zero (hereinbelow denoted ‘high frequencyrange’), and a space between two lines of letter strings is indicated bya range with zero frequency. Further, the CPU 62 uses the projectedhistogram to determine one or more band-shaped regions corresponding tothe one or more high frequency range. A length of one band-shaped regionin the vertical direction (i.e., number of pixels in the verticaldirection) is equal to a length of a high frequency range correspondingto the band-shaped region in the vertical direction. Further, a lengthof one band-shaped region in the horizontal direction (i.e., number ofpixels in the horizontal direction) is equal to a length of the objectregion OA1 in the horizontal direction. Due to this, three band-shapedregions, namely a band-shaped region LA1 including the letter string “Ato E”, a band-shaped region LA2 including the letter string “F to J”,and a band-shaped region LA3 including the letter string “K to M”, aredetermined from among the text region TOA. The process of FIG. 4 endswhen S160 ends.

(Simple Enlargement Process; FIG. 5)

Next, by referring to FIG. 5, an example of a scan image SI satisfyingthe simple enlargement condition executed in S300 of FIG. 2 and contentsof the simple enlargement process executed in S400 of FIG. 2 will bedescribed. In S160 of the aforementioned letter string analyzing process(see FIG. 4), the band-shaped regions were determined. In the scan imageSI shown in FIG. 2, three band-shaped regions LA1 to LA3 are determinedfrom among one text region TOA. In a case where two or more band-shapedregions are determined from one text region, the CPU 62 judges thatthere are two or more lines of letter strings included in the textregion (NO to S300 in FIG. 2), and proceeds to S500.

On the other hand, as shown in FIG. 5, in a case where only oneband-shaped region is determined from one text region (i.e., there isonly band-shaped region LA1), the CPU 62 judges that there is one lineof letter string included in the text region TOA (YES to S300 in FIG.2), and proceeds to S400.

In the simple enlargement process of S400, the CPU 62 judges whether ornot an area of the text region TOA can be enlarged to a targetmagnification (e.g., “1.4”) set in advance in the image processingserver 50. According to experiments, it has been empirically found thatin general, human can easily identify enlarged letters even if theoriginal letters are small, if the size of the letters is enlarged to1.4 times. Accordingly, the enlargement rate that human can easilyidentify is set as the aforementioned target magnification.

The CPU 62 judges whether or not a region in which the area of the textregion TOA has been enlarged without changing the aspect ratio of thetext region TOA in the scan image SI (hereafter denoted as “simplyenlarged region”) can fit in the blank space region BA. Specifically,the CPU 62 multiplies a square root of the target magnification (e.g.,√1.4) to each of the length in the vertical direction and the length inthe horizontal direction of the text region TOA, and determines the sameas a length in the vertical direction and a length in the horizontaldirection of the simply enlarged region. The CPU 62 judges that thesimply enlarged region can fit in the blank space region BA in a casewhere the length of the simply enlarged region in the vertical directionis smaller than the length of the blank space region BA in the verticaldirection, and the length of the simply enlarged region in thehorizontal direction is smaller than the length of the blank spaceregion BA in the horizontal direction. On the other hand, the CPU 62judges that the simply enlarged region cannot fit in the blank spaceregion BA in a case where the length of the simply enlarged region inthe vertical direction is larger than the length of the blank spaceregion BA in the vertical direction, or the length of the simplyenlarged region in the horizontal direction is larger than the length ofthe blank space region BA in the horizontal direction.

The CPU 62 judges that enlargement by the target magnification ispossible in the case of judging that the simply enlarged region can fitin the blank space region BA, and sets the simply enlarged region as thetarget region TA of the text region TOA.

On the other hand, the CPU 62 judges that enlargement by the targetmagnification (e.g., “1.4”) is impossible in the case of judging thatthe simply enlarged region cannot fit in the blank space region BA. Inthis case, the CPU 62 determines a simply enlarged region that would bemaximized and fit in the blank space region BA without changing theaspect ratio of the text region TOA as the target region TA of the textregion TOA. Specifically, the CPU 62 gradually enlarges the text regionTOA along a diagonal line of the text region TOA in a lower rightdirection. The CPU 62 determines the simply enlarged region generated byenlarging the text region TOA to a position where one of the right edgeor lower edge of the simply enlarged region overlaps with the right edgeor lower edge of the blank space region BA as the target region TA.

Next, the CPU 62 enlarges the text object data indicating the textobject TOB using the determined target region TA, and generates enlargedimage data indicating an enlarged image. Specifically, pixel issupplemented in the text object data indicating the text object TOB, thetext object TOB is enlarged so that it overlaps with the right edge andlower edge of the target region TA determined in the direction alongwhich the diagonal line of the text region TOA extends, as a result ofwhich the enlarged image data indicating the enlarged image isgenerated. Next, the CPU 62 overwrites the enlarged image data in theblank space region BA of the scan image data SID. Specifically, the CPU62 overwrites the enlarged image data so that a left edge and upper edgeof the target region TA respectively overlap with a left edge and upperedge of the blank space region BA. As a result, processed image data PIDindicating a processed image PI is completed.

By the foregoing simple enlargement process, enlargement to the targetregion TA can be performed while maintaining the aspect ratio of thetext region TOA. Further, layouts of the plurality of letters “A to E”included in the text region TOA is equal to layouts of the plurality ofletters “A to E” included in the target region TA after the enlargement.The “layouts being the same” herein means that, when the plurality ofletters configuring the M lines of letter strings (M being an integer of1 or more) included in the text region TOA and the plurality of lettersconfiguring the M lines of letter strings included in the target regionTA after the enlargement are compared, a number of letters is the same,magnification of each letter is the same, magnification of spacesbetween the letters is the same, and magnification of spaces between thelines is the same. Moreover, “layout being the same” herein also meansthat, when a partial image in a circumscribing rectangle (i.e., textregion TOA) of the text object TOB in the scan image SI is enlarged, itmatches with a partial image in the target region TA including the textobject within the enlarged image in the processed image data.

(Coupling Process: FIG. 6)

Next, by referring to FIG. 6, contents of the coupling process executedin S500 of FIG. 3 will be described. In S510, the CPU 62 determines onetext region (hereinbelow denoted as “process-subject text region”) amongthe one or more text regions within the scan image SI. Hereinbelow, acase where the text region TOA is determined as the process-subject textregion will be exemplified.

In S520, the CPU 62 generates coupled image data indicating a coupledimage CI in which three lines of letter strings “A to M” included in thetext region TOA are coupled. Specifically, the CPU 62 acquires threepartial image data indicating three band-shaped regions LA1 to LA3 (seeS160 of FIG. 4) determined for the text region TOA from the scan imagedata SID. Then, the CPU 62 couples the acquired three partial image dataso that the three lines of letter strings “A to M” in the threeband-shaped regions LA1 to LA3 are coupled linearly along the horizontaldirection, to thereby generate the coupled image data indicating thecoupled image CI. Upon this occasion, the CPU 62 generates the coupledimage data by supplementing pixels indicating spaces, i.e., pixelshaving background color of the scan image SI so that spaces withpredetermined length in the horizontal direction are formed between thetwo letter strings as coupled (i.e., space between “E” and “F”, andspace between “J” and “K”). That is, the CPU 62 couples three partialimage data via the supplemented pixels to generate the coupled imagedata indicating the coupled image CI. Notably, to delete the space on arear end side of the band-shaped region LA3 (i.e., space existing on theright side than the letter string “K to M”), the CPU 62 deletes the dataindicating such a space within the partial image data indicating theband-shaped region LA3. Due to this, the coupled image data indicatingthe coupled image CI in which no space exists on the rear end side thanthe letter string “A to M” is generated.

In S530, the CPU 62 performs binarizing process on the coupled imagedata generated in S520. Contents of the binarizing process are identicalto S110 of FIG. 4.

In S540, the CPU 62 uses the binary data generated in S530 to determinea plurality of split candidate positions in the coupled image datagenerated in S520. The split candidate positions are candidates of splitpositions for splitting the coupled image data in a rearranging process(S700 of FIG. 3, and FIG. 9 to be described later). Firstly, the CPU 62uses the binary data to generate a projected histogram. The projectedhistogram indicates a distribution of frequency of the ON pixels (i.e.,letter-configuring pixels) in the case of projecting each pixelconfiguring the binary data in the vertical direction. In the projectedhistogram, one letter (for example, “A”) is indicated by a range withfrequency larger than zero, and a space portion between two letters (forexample, the space portion between “A” and “B”) is indicated by a rangewith frequency of zero (hereafter denoted as “zero frequency range”).Further, the CPU 62 uses the projected histogram to determine a rightend of each zero frequency range as the split candidate position.Accordingly, the space portion between two letters is determined as thesplit candidate position, so one letter (for example, “A”) can beprevented from being split in the middle. Notably, in modifiedembodiments the CPU 62 may determine a left end of each zero frequencyrange as the split candidate position, or may determine an intermediateposition of each zero frequency range as the split candidate position.

In S550, the CPU 62 judges whether or not the processes of S510 to S540have been finished for all of the text regions. In a case of judgingthat the processes are not yet finished (NO to S550), the CPU 62determines an unprocessed text region as the process target in S510. Ina case of judging that the processes are finished (YES to S550), the CPU62 ends the process of FIG. 6.

(Target Region Determining Process; FIG. 7)

Next, by referring to FIG. 7, contents of the target region determiningprocess executed in S600 of FIG. 3 will be described. In S630, the CPU62 sets an initial value “1.0” as an enlargement rate ER, and sets aninitial value “1” as a count pointer TP. The enlargement rate ER is anarea enlargement rate for enlarging the text region in a regionenlarging process of S650 described later. The count pointer TP is apointer indicating a count of number that the region enlarging processof S650 described later has been performed. Thus, hereinbelow, termssuch as “TP-th region enlarging process” or “(TP-1)-th region enlargingprocess” may be used to express the counts.

In S640, the CPU 62 adds a predetermined fixed value α (e.g., “0.05”) toa current value (e.g., “1.0”) of the enlargement rate ER to calculate anew value (e.g., “1.05”) for the enlargement rate ER.

In S650, the CPU 62 executes the region enlarging process (see FIG. 8described later). That is, the CPU 62 enlarges the text region TOAaccording to the current value (e.g., “1.05”) of the enlargement rate ERcalculated in S640 to determine each enlarged region.

In S670, the CPU 62 judges whether or not the enlarged region determinedin S650 (e.g., enlarged region EA in FIG. 8) satisfies a predeterminedcondition. In the present embodiment, the predetermined condition is asfollows. For example, if the size of the blank space region isrelatively small, the enlarged region may possibly not fit within theblank space region BA when the text region is enlarged according to theenlargement rate ER. In this case, the CPU 62 cannot appropriatelydetermine the enlarged region using the formula of FIG. 8 describedlater, so it judges that the enlarged region does not satisfy thepredetermined condition (NO to S670). Further, for example, in a casewhere a plurality of enlarged regions is determined in S650, twoenlarged regions among the plurality of enlarged regions may overlapeach other. In this case, the CPU 62 judges that the enlarged regions donot satisfy the predetermined condition (NO to S670). On the other hand,in a case where the enlarged region fits in the blank space region BA,and the two enlarged regions do not overlap each other, the CPU 62judges that the enlarged regions satisfy the predetermined condition(YES to S670).

In the case of judging that the enlarged regions do not satisfy thepredetermined condition (NO to S670), the CPU 62 determines the enlargedregions that were determined in the (TP-1)-th region enlarging processas the target regions TA (see S600 of FIG. 3) in S672. Notably, in acase where the current value of the count pointer TP is “1”, in S672,the CPU 62 determines the text region TOA as the target region TA as itis. The process of FIG. 7 ends when S672 ends.

On the other hand, in judging that the enlarged regions satisfy thepredetermined condition (YES to S670), the CPU 62 judges whether or notthe current value of the enlargement rate ER matches a predeterminedvalue (e.g., “1.4”) in S680. This predetermined value means the maximumenlargement rate for determining the target region TA, which in otherwords means a targeted enlargement rate for enlarging the size of therespective letters in the scan image SI.

In a case of judging that the current value of the enlargement rate ERmatches the predetermined value as above (YES to S680), the CPU 62determines the enlarged region determined in the TP-th region enlargingprocess as the target region TA (e.g., see target region TA in S600 ofFIG. 3) in S682. The process of FIG. 7 ends when S682 ends.

On the other hand, in a case of judging that the current value of theenlargement rate ER does not match the predetermined value as above (NOto S680), the CPU 62 adds “1” to the current value of the count pointerTP and calculates a new value of the count pointer TP in S690. Then, theCPU 62 executes the processes subsequent to S640 again.

(Region Enlarging Process; FIG. 8)

Next, by referring to FIG. 8, contents of the region enlarging processexecuted in S650 of FIG. 7 will be described. In the region enlargingprocess, the CPU 62 enlarges the text region TOA according to theenlargement rate ER, and determines the enlarged region.

Respective rectangles in FIG. 8 show the text region TOA, the blankspace region BA, and the enlarged region EA. The length of the textregion TOA in the horizontal direction (i.e., number of pixels in thehorizontal direction), and the length of the text region TOA in thevertical direction (i.e., number of pixels in the vertical direction)are respectively OPx, OPy. The length of the blank space region BA inthe horizontal direction (i.e., number of pixels in the horizontaldirection), and the length of the blank space region BA in the verticaldirection (i.e., number of pixels in the vertical direction) arerespectively BPx, BPy. Further, two blank spaces in the horizontaldirection (lengths Px1, Px2) and two blank spaces in the verticaldirection (lengths Py1, Py2) exist between the text region OA and theblank space region BA.

The CPU 62 uses formulas (1) to (8) of FIG. 7 to calculate four targetedlengths dx1, dx2, dy1, dy2 to determine positon, aspect ratio, and sizeof the enlarged region EA. The formula (1) indicates that a valueobtained by multiplying an area SO of the text region TOA and thecurrent value of the enlargement rate ER matches an area SC of theenlarged region EA. The formula (2) indicates that the area SO of thetext region TOA can be obtained by multiplying the length OPx of thetext region TOA in the horizontal direction and the length OPy of thetext region TOA in the vertical direction. The formula (3) indicatesthat an area SC of the enlarged region EA is obtained by multiplying asum of the length OPx of the text region TOA in the horizontal directionand two targeted lengths dx1, dx2, and a sum of the length OPy of thetext region TOA in the vertical direction and two targeted lengths dy1,dy2. A formula (4) shows a formula obtained by substituting the area SOof the formula (2) and the area SC of the formula (3) for formula (1). Aformula (5) shows that each of four target lengths dx1, dx2, dy1, dy2can be obtained by multiplying corresponding one of the four blank spacelengths Px1, Px2, Py1, Py2 and a coefficient K. A formula (6) shows aformula that is obtained by substituting the respective target lengthsdx1, dx2, dy1, dy2 of the formula (5) for the formula (4). A formula (7)shows a formula obtained by expanding the formula (6). A formula (8)shows a formula for calculating the coefficient K by using coefficientsa, b, c of the formula (7). If the coefficient K is substituted for theformula (5), the four target lengths dx1, dx2, dy1, dy2 can becalculated.

According to the formulas (1) to (8) in FIG. 8, the following enlargedregion EA is obtained. According to the formula (5), a relationship of“dx1+dx2=K×(Px1+Px2)” and a relationship of “dy1+dy2=K×(Py1+Py2)” areobtained. Accordingly, a differential length in the horizontal direction(i.e., dx1+dx2) becomes larger than a differential length in thevertical direction (i.e., dy1+dy2) in a case where a sum of two blankspace lengths in the horizontal direction (i.e., Px1+Px2) is larger thana sum of two blank space lengths in the vertical direction (i.e.,Py1+Py2), and the differential length in the horizontal direction (i.e.,dx1+dx2) becomes smaller than the differential length in the verticaldirection (i.e., dy1+dy2) in a case where the sum of two blank spacelengths in the horizontal direction (i.e., Px1+Px2) is smaller than thesum of two blank space lengths in the vertical direction (i.e.,Py1+Py2). As above, an aspect ratio of the enlarged region EA thatdiffers from the aspect ratio of the text region TOA, a size of theenlarged region EA, and a position of the enlarged region EA aredetermined based on the two blank space lengths Px1, Px2 in thehorizontal direction and the two blank space lengths Py1, Py2 in thevertical direction. Further, the enlarged region EA may be determined asthe target region TA (see S672, S682 of FIG. 7).

(Rearranging Process; FIG. 9)

Next, contents of the rearranging process executed in S700 of FIG. 3will be described with reference to FIG. 9. In S710, the CPU 62determines one text region TOA as the process target from among the oneor more text regions included in the scan image SI. Hereinbelow, thetext region determined as the process target in S710 will be termed a“process-subject text region”. Further, a target region determined inconnection to the process-subject text region will be termed a“process-subject target region”, and coupled image data indicating acoupled image (e.g., CI in FIG. 3) in which each of letter stringsincluded in the process-subject text region is coupled will be termed“process-subject coupled image data”.

In S720, the CPU 62 sets an initial value OPx (i.e., the length of theprocess-subject text region in the horizontal direction) as the length Win the horizontal direction (i.e., number of pixels W in the horizontaldirection) of a candidate rearranged region being a candidate of arearranged region to be determined (see RA in FIG. 3), and also sets aninitial value OPy (i.e., the length of the process-subject text regionin the vertical direction) as the length H in the vertical direction(i.e., number of pixels H in the vertical direction) of the candidaterearranged region.

In S730, the CPU 62 judges whether or not a ratio W/H of the length H inthe vertical direction and the length W in the horizontal direction ofthe candidate rearranged region is smaller than a ratio TW/TH of alengthTH in the vertical direction TH and a length TW in the horizontaldirection of the process-subject target region.

In a case of judging that the ratio W/H is less than the ratio TW/TH(YES to S730), the CPU 62 adds a predetermined fixed value β (e.g. 1pixel) to the current length W of the candidate rearranged region in thehorizontal direction to determine a new length W of the candidaterearranged region in the horizontal direction in S732. The processproceeds to S740 when S732 is finished.

On the other hand, in a case of judging that the ratio W/H is equal toor more than the ratio TW/TH (NO to S730), the CPU 62 subtracts thepredetermined fixed value β (e.g. 1 pixel) from the current length W ofthe candidate rearranged region in the horizontal direction to determinea new length W of the candidate rearranged region in the horizontaldirection in S734. When S734 is finished, the process proceeds to S740.Notably, in the present embodiment, the same fixed value β is used inS732 and S734, however, the fixed value in S732 and the fixed value inS734 may be different values in a modification.

In S740, the CPU 62 determines a length m between lines along thevertical direction (i.e., a number of pixels m between the lines)according to a resolution of the scan image data SID. For example, in acase where the resolution of the scan image data SID is 300 dpi, the CPU62 determines 1 pixel as the length m between the lines, and in a casewhere the resolution of the scan image data SID is 600 dpi, the CPU 62determines 2 pixels as the length m between the lines. That is, the CPU62 determines a larger length m between the lines for higher resolutionsof the scan image data SID. According to this configuration, the CPU 62can determine the length m between the lines having an appropriate sizeaccording to the resolution of the scan image data SID. Notably, in amodification, a fixed value may be employed as the length m between thelines irrelevant to the resolution of the scan image data SID.

In S750, the CPU 62 executes a line number determining process based onthe process-subject coupled image data and the new length W of thecandidate rearranged region in the horizontal direction as determined inS732 or S734 (see FIG. 10 described later). In the line numberdetermining process, the CPU 62 determines a number of lines for a caseof rearranging a plurality of letters (e.g., “A to M”) included in theprocess-subject coupled image (e.g., CI in FIG. 3) within the candidaterearranged region.

(Line Number Determining Process; FIG. 10)

As shown in FIG. 10, in S751, the CPU 62 judges whether or not a lengthIW of the process-subject coupled image in the horizontal direction(e.g., CI in FIG. 11) is equal to or less than the length W of thecandidate rearranged region in the horizontal direction. In a case ofjudging that the length IW is equal to or less than the length W (YES toS751), the CPU 62 determines “1” as the number of lines in S752. This isbecause all of the letters “A to M” included in the process-subjectcoupled image CI can be fitted within the candidate rearranged region ina state where all of the letters “A to M” are aligned in a straightline. The process of FIG. 10 ends when S752 finishes.

On the other hand, in judging that the length IW is larger than thelength W (NO to S751), the plurality of letters “A to M” included in theprocess-subject coupled image CI needs to be arranged by being split.Due to this, the CPU 62 executes S753 and 754 to select one or moresplit candidate positions from among a plurality of split candidatepositions determined in S540 of FIG. 6 (e.g., see a plurality of arrowsgiven to the process-subject coupled image CI in FIG. 10).

In S753, the CPU 62 selects one split candidate position from among theplurality of split candidate positions so that the selected length SWbecomes a maximum length that is equal to or less than the length W ofthe candidate rearranged region in the horizontal direction. In a statewhere the one split candidate position is not yet selected, the selectedlength SW is a length in the horizontal direction between a fore end ofthe process-subject coupled image CI and the split candidate position tobe selected. Further, in a state where the one or more split candidateposition is already selected, the selected length SW is a length in thehorizontal direction between the split candidate position that wasselected most recently and the split candidate position, existing closerto a rear end than the aforementioned split candidate position, and thatis to be newly selected. In the example of FIG. 10, the split candidateposition between the letter “F” and the letter “G” is selected.

In S754, the CPU 62 judges whether or not a remaining length RW is equalto or less than the length W of the split candidate position in thehorizontal direction. The remaining length RW is a length in thehorizontal direction between the most recently selected split candidateposition and the rear end of the process-subject coupled image. In acase of judging that the remaining length RW is larger than the length W(NO to S754), the CPU 62 returns to S753, and newly determines a splitcandidate position existing further on the rear end side than the mostrecently selected split candidate position from among the plurality ofsplit candidate positions.

On the other hand, in case of judging that the remaining length RW isequal to or less than the length W (YES to S754), the CPU 62 determinesa number obtained by adding “1” to the number of selected splitcandidate position as the number of lines. The process of FIG. 10 endswhen S755 finishes.

(Continuation of Rearranging Process; FIG. 9)

In S760 of FIG. 9, the CPU 62 determines the new length H of thecandidate rearranged region in the vertical direction according to theformula in S760. In the formula of S760, “m” denotes the length betweenthe lines as determined in S740, “n” denotes the number of the linesdetermined in S750, and “h” denotes the length of the process-subjectcoupled image data in the vertical direction (see h in the coupled imageCI of FIG. 10).

In S770, the CPU 62 judges whether or not the aspect ratio W/H of thecandidate rearranged region approximates the aspect ratio TW/TH of theprocess-subject target region. Specifically, the CPU 62 judges whetheror not the aspect ratio W/H of the candidate rearranged region isincluded in a predetermined range set based on the aspect ratio TW/TH ofthe process-subject target region. The predetermined range is a rangebetween a value obtained by subtracting a value γ from the aspect ratioTW/TH of the process-subject target region and a value obtained byadding the value γ to the aspect ratio TW/TH of the process-subjecttarget region. Notably, the value γ may be a predetermined fixed value,or may be a value obtained by multiplying a predetermined coefficient(e.g., 0.05) to TW/TH.

In a case of judging that the aspect ratio W/H of the candidaterearranged region does not approximate the aspect ratio TW/TH of theprocess-subject target region (NO to S770), the CPU 62 executesrespective processing of S730 to S760 again. Due to this, the CPU 62determines the new length W in the horizontal direction and the newlength H in the vertical direction of the candidate rearranged region,and executes the judgment of S770 again.

On the other hand, in a case of judging that the aspect ratio W/H of thecandidate rearranged region approximates the aspect ratio TW/TH of theprocess-subject target region (YES to S770), the CPU 62 firstlydetermines the candidate rearranged region having the length W in thehorizontal direction and the length H in the vertical direction as therearranged region (e.g., RA in FIG. 3) in S780. Then, in a case wherethe one or more split candidate positions have been selected in S753 ofFIG. 10, the CPU 62 splits the process-subject coupled image data at theone or more split candidate positions, and generates two or more splitimage data indicating two or more split images. Next, the CPU 62arranges the two or more split image data in the rearranged region sothat the two or more split images align along the vertical direction. Atthis occasion, the CPU 62 arranges the two split image data so that thespace between the lines as determined in S740 is formed between the twosplit images being adjacent along the vertical direction. As a result,as shown in S700 of FIG. 3, for example, rearranged image dataindicating the rearranged image RI in which the plurality of letters “A”to “M” is rearranged in the rearranged region RA is generated. The sizeof the plurality of letters “A” to “M” in the rearranged image RI isequal to the size of the plurality of letters “A” to “M” in the scanimage SI.

In S790, the CPU 62 judges whether or not the processes from S710 toS780 have been completed for all of the text regions included in thescan image SI. In a case of judging that the processes have not beencompleted (NO to S790), the CPU 62 determines an unprocessed text regionas the process subject in S710, and executes the processes of S712 andsubsequent steps again. Then, in a case of judging that the processeshave been completed (YES to S790), the CPU62 ends the process of FIG. 9.

(Case A; FIG. 11)

Next, a specific case A will be described in connection to therearranging process pf S700 of FIG. 3 (see FIG. 9) and the enlargingprocess of S800 by referring to FIG. 11. As shown in (A1), the lengthOPx in the horizontal direction OPx and the length OPy in the verticaldirection of the process-subject text region TOA are set respectively asthe initial value of the length W in the horizontal direction and theinitial value of the length H in the vertical direction of the candidaterearranged region (S720 of FIG. 9). In the present case, W/H is lessthan TW/TH. That is, when compared to the process-subject text regionTOA, the process-subject target region TA has a shape that ishorizontally long. In this case, if the candidate rearranged region isreshaped to a horizontally long shape, the aspect ratio of the candidaterearranged region approaches the aspect ratio of the process-subjecttarget region TA. Accordingly, as shown in (A2), the fixed value β isadded to the current length W of the candidate rearranged region in thehorizontal direction, and the new length W of the candidate rearrangedregion in the horizontal direction is determined (S732). In this case,as the number of lines, three lines including the letter string “A toE”, the letter string “F to J”, and the letter string “K to M” aredetermined (S750). Then, the new length H of the candidate rearrangedregion in the vertical direction is determined (S760).

In the state of (A2), since the aspect ratio W/H of the candidaterearranged region does not approximate the aspect ratio TW/TH of theprocess-subject target region TA (NO to S770), the fixed value β isagain added to the current length W of the candidate rearranged regionin the horizontal direction, and the new length W of the candidaterearranged region in the horizontal direction is determined again(S732). In this case, as the number of lines, three lines including theletter string “A to F”, the letter string “G to L”, and the letterstring “M” are determined (S750). That is, the maximum number of lettersthat can configure one line of letter string within the candidatearranged region is increased due to the increase in the length W of thecandidate rearranged region in the horizontal direction. Then, the newlength H of the candidate rearranged region in the vertical direction isdetermined (S760). Thereafter, the processes of S 730 to S770 arerepeatedly executed until the aspect ratio W/H of the candidaterearranged region is judged as approximating the aspect ratio TW/TH ofthe process-subject target region TA.

As shown in (A3), the aspect ratio W/H of the candidate rearrangedregion approximates the aspect ratio TW/TH of the process-subject targetregion TA (YES to S770). Notably, in this case, two lines, including theletter string “A to G” and the letter string “H to M”, are determined asthe number of lines (S750). Accordingly, as shown in (A4), the candidaterearranged region of (A3) is determined as the rearranged region RA(S780). In this case, the aspect ratio W/H of the rearranged region RAis normally closer to the aspect ratio TW/TH of the process-subjecttarget region TA than the aspect ratio of the process-subject textregion TOA. Next, the process-subject coupled image data indicating theprocess-subject coupled image CI is split, and two split image dataindicating two split images DI1, DI2 are generated (S780). Then, twosplit image data are arranged in the rearranged region RI so that thetwo split images DI1, DI2 are arranged along the vertical direction, anda space having a length m is formed between the adjacent two splitimages. As a result, the rearranged image data indicating the rearrangedimage RI is generated (S780).

Next, the rearranged image data is enlarged to generate enlarged imagedata indicating an enlarged image (S800 of FIG. 3). Specifically, therearranged image RI is enlarged in a direction along which a diagonalline of the rearranged image RI extends, as a result of which theenlarged image data indicating the enlarged image is generated. Forexample, in a case where the aspect ratio W/H of the rearranged regionRA is equal to the aspect ratio TW/TH of the process-subject targetregion TA, all of four sides of the enlarged image match the four sidesof the subject target region TA. That is, in this case, the size of theenlarged image matches the size of the target region TA. However, forexample, in a case where the aspect ratio W/H of the rearranged regionRA is not equal to the aspect ratio TW/TH of the process-subject targetregion TA, the enlargement of the rearranged image RI ends at a statewhere one of the sides of the enlarged images matched one of the sidesof the process-subject target region TA in the course of graduallyenlarging the rearranged image RI. That is, in this case, the size ofthe enlarged image becomes smaller than the size of the target regionTA.

Next, as shown in (A5), the enlarged image data in which the rearrangedimage data indicating the rearranged image RI is enlarged is overwrittenin the target region TA of the scan image data SID (S800 of FIG. 3). Asa result, the processed image data PID indicating the processed image PIis completed. In the processed image PI, a layout of the plurality ofletters “A to M” included in the text region TOA is different from alayout of the plurality of letters “A to M” after the enlargement asincluded in the target region TA. Notably, “the layouts being different”herein means that there is a difference at least in a number of letters,or in a magnification of letters, spaces between the letters, or spacesbetween the lines, in comparing the plurality of letters configuring theM lines of letter strings included in the text region TOA and theplurality of letters configuring the M lines of letter strings after theenlargement as included in the target region TA. More specifically, “thelayouts being different” herein can also be said as that an enlargementof a partial image within the circumscribing rectangle (i.e., textregion TOA) in the text object TOB of the scan image SI does not match apartial image in the target region TA including the text object withinthe enlarged image in the processed image data.

As mentioned above, in the present embodiment, relatively small length m(e.g., 1 pixel, 2 pixels, etc.) between the lines is determined in S740of FIG. 9, and this length m between the lines is employed in therearranged image RI. Accordingly, the length m between the lines in therearranged image RI is normally smaller than the length between thelines in the scan image SI.

As a result, the ratio of the length of the spaces between the lineswith respect to the length of the plurality of letters in the processedimage PI obtained by enlarging the rearranged image RI in the verticaldirection (e.g., the length of the letter “A” in the vertical direction)becomes smaller than the ratio of the length of the spaces between thelines with respect to the length of the plurality of letters in the scanimage SI in the vertical direction. As above, the present embodiment canmake the length of the spaces between the lines in the processed imagePI relatively small, based on which compactization the letters canappropriately be enlarged in the processed image PI.

(Case B; FIG. 12)

Next, a case B will be described by referring to FIG. 12. As shown in(B1), in the present case, the ratio W/H is larger than the ratio TW/TH.That is, the process-subject target region TA has a vertically longshape compared to the ratio of the process-subject text region TOA. Inthis case, the aspect ratio of the candidate rearranged region comescloser to the aspect ratio of the process-subject target region TA bymaking the candidate rearranged region to be in a vertically long shape.Accordingly, as shown in (B2), the fixed value P3 is subtracted from thecurrent length W of the candidate rearranged region in the horizontaldirection, and the new length W of the candidate rearranged region inthe horizontal direction is determined (S734). In this case, as thenumber of lines, four lines including the letter string “A to D”, theletter string “E to H”, the letter string “I to L”, and the letterstring “M” are determined (S750). That is, in this case, the maximumnumber of letters that can configure one line of letter string in thecandidate rearranged region is decreased owing to the length W of thecandidate rearranged region in the horizontal direction becoming small.Further, the new length H of the candidate rearranged region in thevertical direction is determined (S760).

In the state of (B2), the aspect ratio W/H of the candidate rearrangedregion approximates the aspect ratio TW/TH of the process-subject targetregion TA (YES to S770). Accordingly, as shown in (B3), the candidaterearranged region of (B2) is determined as the rearranged region RA(S780). Next, the process-subject coupled image data indicating theprocess-subject coupled image CI is split, and four split image dataindicating four split images DI4 to DI7 are generated (S780). Then,similar to the case A of FIG. 11, the rearranged image data indicatingthe rearranged image RI is generated (S780), and as shown in (B4), theenlarged image data in which the rearranged image data is enlarged iscreated, and the enlarged image data is overwritten in the target regionTA of the scan image data SID (S800 of FIG. 3). As a result, theprocessed image data PID indicating the processed image PI is completed.In the processed image PI, the layout of the plurality of letters “A toM” included in the text region TOA is different from the layout of theplurality of letters “A to M” after the enlargement as included in thetarget region TA:

Effects of the First Embodiment

According to the present embodiment, the image processing server 50 canexecute different types of enlarging processes according to a judgingresult on whether to execute a first type of enlarging process, or asecond type of enlarging process. The different types of enlargingprocesses includes a simple enlargement process S400 of FIG. 2) thatdoes not change the layout of the plurality of letters included in thetext object, and an enlarging process (S500 and S800 of FIG. 3) by whichthe layout may be changed. Due to this, in a case of judging that thesimple enlargement process should be executed, the layout of theplurality of letters included in the text object TOB does not have to bechanged upon generating the processed image data.

Further, according to the present embodiment, before executing thepossesses of S500 to S800 shown in FIG. 3, the judgment on whether ornot the simple enlargement condition is satisfied is made. As a result,in the case where the simple enlargement condition is satisfied, theimage processing server 50 can generate the enlarged image data withoutexecuting the possesses of S500 to S800 shown in FIG. 3. Processing loadon the image processing server 50 can be reduced.

Further, in the case where the letter string included in the text objectTOB is configured only of one line, then in most cases the creator ofthe document intentionally describes so using only one line. Forexample, in a case where the scan image SI is an image indicating aslide for a presentation, the title of the slide may be described in oneline. In this case, if the layout of the letter string described by theone line is changed to a plurality of letter strings, such a changemight be against the intention of the creator of the document. Thepresent embodiment executes the simple enlargement process withoutchanging the layout of the letter string included in the text objectTOB, if the letter string included in the text object TOB is configuredonly of one line. As a result, the layout can be prevented from beingchanged against the intention of the creator.

(Corresponding Relationship)

The image processing server 50 is an example of an “image processingdevice”. The scan image SI is each example of an “original image”. Theblank space region BA is an example of a “space region”. The horizontaldirection and the vertical direction are respectively an example of a“first direction” and a “second direction”. The two blank space lengthsPx1, Px2 in the horizontal direction and the two blank space lengthsPy1, Py2 in the vertical direction are respectively an example of “twoblank space lengths along the first direction”, and “two blank spacelengths along the second direction”.

The simple enlargement process in S400 of FIG. 2 is an example of a“first type of enlarging process”, and the processes from S500 to S800of FIG. 3 are an example of a “second type of enlarging process”.

The mechanism that judges whether or not the letter string included inthe text region TOA is one line in S300 of FIG. 2 is an example of aconfiguration for “judging whether to execute a first type of enlargingprocess or execute a second type of enlarging process based on M linesof letter strings”, and is also an example of a configuration for“judging whether M is 1, or M is two or more”. Further, theconfiguration that judges whether or not the letter string included inthe text region TOA is one line in S300 of FIG. 2 can be said as being“judging whether to execute a first type of enlarging process or executea second type of enlarging process based on a characteristic of M linesof letter strings (or a characteristic of the text object) (which is inthe present embodiment, the number of lines of the letter string in thetext object TOB)”.

Hereinbelow, points different from the first embodiment will bedescribed in connection to second to sixth embodiments. In the second tosixth embodiments, the contents of the processes of S300 of FIG. 2differ from that of the first embodiment.

Second Embodiment; FIG. 13

As shown in FIG. 13, the CPU 62 of the image processing server 50 judgeswhether or not the simply enlarged region, in which the text region TOAof the scan image data SI2 is enlarged by the target magnification(e.g., 1.4) in S300 fits in the blank space region BA determined in S200of FIG. 2. Specifically, the CPU 62 multiplies a square root (e.g.,√1.4) of the target magnification to each of the length in the verticaldirection and the length in the horizontal direction of the text regionTOA, and determines them as the length in the vertical direction and thelength in the horizontal direction of the simply enlarged region. TheCPU 62 judges that the simply enlarged region fits within the blankspace region BA in a case where the length of the simply enlarged regionin the vertical direction is equal to or less than the length of theblank space region BA in the vertical direction, and the length of thesimply enlarged region in the horizontal direction is equal to or lessthan the length of the blank space region BA in the horizontaldirection. On the other hand, the CPU 62 judges that the simply enlargedregion does not fit within the blank space region BA in at least one ofthe following cases: a case where the length of the simply enlargedregion in the vertical direction is larger than the length of the blankspace region BA in the vertical direction, and a case where the lengthof the simply enlarged region in the horizontal direction is larger thanthe length of the blank space region BA in the horizontal direction.

The CPU 62 determines the simply enlarged region as the target region TAin the case of judging that the simply enlarged region fits within theblank space region BA (YES to S300) and proceeds to S 400, and on theother hand, proceeds to S500 of FIG. 3 in the case of judging that thesimply enlarged region does not fit within the blank space region BA (NOto S300).

In S400, similar to S400 of the first embodiment, the CPU 62 executesthe simple enlargement process. Notably, in this embodiment, in S300, ithas been judged that the area of the text region TOA can be enlarged bythe target magnification without changing the aspect ratio of the textregion TOA. Due to this, in S400, the CPU 62 enlarges the text regionTOA up to the target region TA as determined to generate the enlargedimage data indicating the enlarged image.

According to the present embodiment, the judgment on whether the textregion TOA can be enlarged by the target magnification is made beforeexecuting the processes of S500 to S800 shown in FIG. 3. As a result, inthe case where such enlargement is possible, the image processing server50 can generate the enlarged image data without executing the processesof S500 to S800 shown in FIG. 3. The processing load on the imageprocessing server 50 can be reduced.

Further, according to the present embodiment, the simple enlargementprocess is executed without changing the layout of the letter stringsincluded in the text region TOA. As a result, any change in the layoutthat would be against the intention of the creator can be avoided.

(Corresponding Relationship)

The square root of the target magnification is an example of a “targetvalue”, the length in the horizontal direction and the length in thevertical direction of the target region TA are respectively an exampleof a “first length” and a “second length”. The length in the horizontaldirection and the length in the vertical direction of the blank spaceregion BA are respectively an example of a “length along the firstdirection of the space region” and a “length along the second directionof the space region”. The length of the target region TA in the verticaldirection being smaller than the length of the blank space region BA inthe vertical direction and the length of the target region TA in thehorizontal direction being smaller than the length of the blank spaceregion BA in the horizontal direction is an example of a “predeterminedcondition”.

Third Embodiment; FIG. 14

As shown in FIG. 14, the CPU 62 of the image processing server 50 judgesin S300 whether or not the text object TOB included in the text regionTOA is expressed in itemized form.

Specifically, the CPU 62 firstly generates a projected histogramcorresponding to the text region TOA included in the scan image SI3.Notably, the projected histogram indicates a distribution of frequencyof ON pixels in a case where the respective pixels indicating theband-shaped regions LA1 to LA4 are projected in the vertical direction,for each of the plurality of band-shaped regions LA1 to LA4 included inthe text region TOA (see S160), among the plurality of pixelsconfiguring the binary data BD generated from the scan image SI3 (seeS110). In other words, the projected histogram indicates thedistribution of frequency of pixels for letters in the case ofprojecting the respective pixels indicating the text region TOA in thevertical direction. In the projected histogram, each of the one or moreletters included in each line of letter strings is indicated in a highfrequency range, and a space between two letters is indicated in a rangeof which frequency is zero. Further, a range from a rear end of the lastletter in each line of letter strings to a rear end of the band-shapedregion of the corresponding line is indicated in a range of whichfrequency is zero.

Specifically, the projected histogram of the present embodimentindicates the frequency of the ON pixels in the case of projecting therespective pixels aligned in the horizontal direction in the band-shapedregions LA1 to LA4 in the vertical direction (see (1) and (2) of FIG.14). The CPU 62 extracts fore end high frequency ranges FH1 to FH4,which are high frequency ranges positioned at the fore end from thehistograms generated for each of the band-shaped regions LA1 to LA4.Then, as shown in (1) and (2) of FIG. 14, in connection to the frequencyof the ON pixels at each position in the fore end high frequency rangeFH1 and the frequency of the ON pixels at corresponding positions in thefore end high frequency range FH4, the CPU 62 calculates a difference inthe frequency of the ON pixels for each of those positions, anddetermines a sum D of those differences.

The CPU 62 determines the sum D similarly for each of a pair of the foreend high frequency of range FH1 and the fore end high frequency rangeFH2, a pair of the fore end high frequency range FH1 and the fore endhigh frequency range FH3. Then, in a case where the three sums asdetermined are all equal to or less than a predetermined threshold(e.g., “5”), the CPU 62 judges that the text object TOB is expressed inthe itemized form (YES to S300), and executes the simple enlargementprocess. On the other hand, in a case where the three sums as determinedare all larger than the predetermined threshold, the CPU 62 judges thatthe text object TOB is not expressed in the itemized form (NO to S300),and executes processes of S500 and thereafter. In the simple enlargementprocess, the CPU 62 generates the enlarged image data by executingprocesses similar to those of the first embodiment.

According to the present embodiment, the judgment as to whether the textobject TOB is expressed in itemized form or not is made before executingthe processes of S500 to S800 shown in FIG. 3. As a result, upondetermining that the enlargement is possible, the image processingserver 50 can generate the enlarged image data without executing theprocesses of S500 to S800 shown in FIG. 3. The processing load on theimage processing server 50 can be reduced.

In the case where the text object TOB is expressed in the itemized form,any change in the layout of the plurality of letters included in thetext object TOB may cause the itemized contents unclear. In the presentembodiment, in the case of judging that the text object TOB is expressedin the itemized form, the simple enlargement process is executed withoutchanging the layout of the plurality of letters included in the textobject TOB. As a result, changes in the layout of the plurality ofletters expressed in the itemized form can be avoided.

In the present embodiment, the configuration that judges whether toexecute the simple enlargement process or to execute the processes ofS500 and thereafter based on the fore end high frequency ranges FH1 toFH4 is an example of “judging whether to execute a first type ofenlarging process or execute a second type of enlarging process based onM lines of letter strings”. Further, this configuration can be said as“judging whether to execute the first type of enlarging process or toexecute the second type of enlarging process based on a characteristicof M lines of letter strings (or a characteristic of text object) (i.e.,the projected histogram of the text object)”.

Fourth Embodiment; FIG. 15

As shown in FIG. 15, the CPU 62 of the image processing server 50 judgesin S300 whether or not a variation among blank spaces of the respectivelines included in the text region TOA is large.

Specifically, similar to the third embodiment, the CPU 62 firstlygenerates the projected histograms for the band-shaped regions LA1 toLA4. Then, the CPU 62 specifies a distance BL1 from the rear end of thehigh frequency range positioned backmost to a right end of theband-shaped region LA1 in the projected histogram of the band-shapedregion LA1. Due to this, a blank space length of the first line of theletter string is specified. Notably, the distance BL1 is specified bythe number of pixels.

Next, the CPU 62 specifies distances BL2 to BL4 for each of the otherband-shaped regions LA2 to LA4 in a similar manner. Then, the CPU 62judges that the variation in the blank spaces at the rear ends of therespective lines of letter strings included in the text region TOA islarge (YES to S300) in a case where a sum of absolute values ofrespective differences between the average values of the distances BL2to BL4 and the distances BL2 to BL4 is equal to or larger than athreshold (e.g., 100), and executes the simple enlargement process. Onthe other hand, the CPU 62 judges that the variation in the blank spacesat the rear ends of the respective lines of letter strings included inthe text region TOA is small (NO to S300) in a case where the sum of theabsolute values of respective differences between the average values ofthe distances BL2 to BL4 and the distances BL2 to BL4 is less than thethreshold, and executes the processes of S500 and thereafter. In thesimple enlargement process, the CPU 62 generates the enlarged image databy executing the processes similar to the first embodiment.

In the case where the variation in the blank spaces at the rear ends ofthe respective lines is large, then in most cases the creator of thedocument intentionally breaking the lines. For example, as shown in FIG.15, in the case of the itemized form, the blank space lengths in therespective lines vary depending on the length of the item described ineach line. Further, for example, as shown in FIG. 19, an address of aletter is being described in the text region TOA. In such a case, if thelayout of the plurality of letters included in the text object TOB ischanged, such a change in the layout might be against the intention ofthe creator of the document. The present embodiment executes the simpleenlargement process without changing the layout of the letter stringincluded in the text object TOB, if the variation in the blank spaces atthe rear ends of the respective lines is large. As a result, the layoutcan be prevented from being changed against the intention of thecreator.

(Corresponding Relationship)

Of the projected histograms of the respective band-shaped regions LA1 toLA4, the rear ends of the high frequency range positioned backmost sideare an example of “a one end of a line of letter string”, and the rightends of the respective band-shaped regions LA1 to LA4 are an example of“a boundary of text regions”. The distances BL1 to BL4 are an example of“blank space lengths”. The sum of the absolute values of the differencesbetween the average values of the distances BL1 to BL4 and the distancesBL1 to BL4 is an example of a variation of M blank space lengthscalculated for the M lines of letter strings, and the threshold is anexample of “a predetermined variation”.

In the present embodiment, the configuration that judges whether toexecute the simple enlargement process or to execute the processes ofS500 and thereafter based on the distances BL1 to BL4 is an example of“judging whether to execute a first type of enlarging process or executea second type of enlarging process based on M lines of letter strings”.Further, this configuration can be said as “judging whether to executethe first type of enlarging process or to execute the second type ofenlarging process based on a characteristic of M lines of letter strings(or a characteristic of text object) (i.e., the blank space lengths)”.

As an alternative to the use of the variation of the blank space lengthsat the rear ends of the respective lines of letter strings included inthe text region TOA of the present embodiment, the judgment on whetherto execute the simple enlargement process or to execute the processes ofS500 and thereafter can be judged by using the variation in blank spacesat fore ends of the respective lines of letter strings. In this case,the CPU 62 may specify a distance from the fore end of the highfrequency range positioned on the foremost side to a left end of theband-shaped region (i.e., blank space length), for each of theband-shaped regions LA1 to LA4, from among the projected histograms ofthe band-shaped regions. According to this configuration, an undesiredchange in the layout against the creator's intention can be avoided, forexample, in a case where the respective lines of letter strings arecentered (e.g., as in a course menu in a restaurant). The blank spacelengths of the fore ends in the layout of the plurality of lettersincluded in the text object TOB is an example of “a blank space lengthalong the first direction between one end of the one line of letterstring and the boundary of the text regions”.

Fifth Embodiment; FIG. 16

As shown in FIG. 16, the CPU 62 of the image processing server 50 judgesin S300 whether or not a line that is extremely large in regards to itsline width (i.e., the length in the vertical direction) as compared tothe widths of other lines exists among the lines of letter stringsincluded in the text region TOA.

Specifically, the CPU 62 firstly specifies widths LH1 to LH4 of theband-shaped regions LA1 to LA4, for each of the plurality of band-shapedregions LA1 to LA4 included in the text region TOA (see S160). Notably,the widths LH1 to LH4 are indicated by the numbers of pixels. As shownin FIG. 16, the first letter “A” is described using two lines configuredof other letters, namely the line of “B to E” and the line of “F to I”.In this case, in S160, one band-shaped region LA1 including the letter“A”, the line of “B to E” and the line of “F to I” is determined.

Next, the CPU 62 judges that the line with the extremely large linewidth exists (YES to S300) in a case where there is a width that isequal to or larger than K times the average of the widths LH1 to LH4(e.g., K=1.5) among the widths LH1 to LH4, and executes the simpleenlargement process. On the other hand, in a case where there is nowidth that is equal to or larger than K times the average of the widthsLH1 to LH4 among the widths LH1 to LH4 (NO to S300), the CPU 62 judgesthat the line with the extremely large line width is does not exist, andexecutes the processes of S500 and thereafter. In the simple enlargementprocess, the CPU 62 generates the enlarged image data by executingprocesses similar to the first embodiment.

According to this configuration, the judgment as to whether or not aspecific letter (e.g., the “A” as aforementioned) that is extremelylarge compared to other letters is included in the plurality of lettersincluded in the text region TOA can be made. For example, in articles ina newspaper or magazine, in some cases the first letter of a sentence isindicated larger than other letters. In such a case, for example, whenthe processes of S500 and thereafter are executed and the enlargingprocess is executed, the band-shaped region LA1 and the band-shapedregion LA2 may in some cases be coupled. In such a case, the letterstrings that are shown in two lines are suddenly expressed by one lineafter the letter “J”, which makes it difficult to read. In the presentembodiment, the aforementioned circumstance can be avoided. Further,according to the present embodiment, the simple enlargement process isexecuted without changing the layout of the letter strings included inthe text region TOA. As a result, the layout can be avoided from beingchanged against the intention of the creator.

In the present embodiment, the configuration that judges whether toexecute the simple enlargement process or to execute the processes ofS500 and thereafter based on whether or not a line with extremely largewidth compared to other lines included therewith is an example of“judging whether to execute a first type of enlarging process or executea second type of enlarging process based on M lines of letter strings”.Further, this configuration can be said as being “judging whether toexecute a first type of enlarging process or execute a second type ofenlarging process based on the characteristic of M lines of letterstrings (or characteristic of the text object) (i.e., the width of thelines of letter strings included in the text object TOB)”.

Sixth Embodiment; FIG. 17

As shown in FIG. 17, the CPU 62 of the image processing server 50 judgesin S300 whether or not a background color of the text region TOA differsfrom a background color of the scan image SI6.

In the letter string analyzing process of the present embodiment, theCPU 62 executes the processes of S110 to S150 similar to the letterstring analyzing process of the first embodiment. In the binarizingprocess of S110, the most frequent pixel value indicating white color isdetermined as the background color. As a result, in the binary data BD,the respective pixels in the text region TOA indicate the pixel value“1”, similar to the respective pixels in each of the picture objectsOB1, OB2. Due to this, one unit region corresponding to the text objectTOB is determined in the labelling process of S120 and the rectangularregion determining process of S130.

Next, in the type determining process of S150, normally the frequenciesof only two pixel values (e.g., brightness values) including a pixelvalue indicating black color and a pixel value indicating yellow colorare larger than zero in the histogram corresponding to the object regionTOA of the scan image SI6. Accordingly, the CPU 62 judges that theobject regions TOA is a text region. However, since the respectivepixels in the text region TOA are of the pixel value “1”, no band-shapedregion is determined in S160.

In S200, in a case where all of the pixels in the text region TOA are ofthe pixel value “1” in the binary data BD generated in S110, the CPU 62judges that the background color of the text region TOA differs from thebackground color of the scan image SI6 (YES to S300) and executes thesimple enlargement process. On the other hand, in a case where pixelswith the pixel value “0” are included in the text region TOA in thebinary data BD generated in S110, the CPU 62 judges that the backgroundcolor of the text region TOA is the same as the background color of thescan image SI6 (NO to S300) and executes the processes of S500 andthereafter. In the simple enlargement process, the CPU 62 generates theenlarged image data by executing processes similar to the firstembodiment.

For example, to make the title of presentation materials stand out, thebackground color of the text region TOA is sometimes changed. In thiscase, if the layout of the plurality of letters included in the textobject TOB is changed, the layout may be changed against the intentionof the creator of the document. In the present embodiment, the simpleenlargement process is executed without changing the layout of theplurality of letters included in the text object TOB when the backgroundcolor of the text region TOA differs from the background color of thescan image S16. As a result, the layout can be prevented from beingchanged against the intention of the creator.

In the present embodiment, the configuration that judges whether toexecute the simple enlargement process or to execute the processes ofS500 and thereafter based on whether or not the background color of thetext region TOA differs from the background color of the scan image SI16is an example of “judging whether to execute a first type of enlargingprocess or execute a second type of enlarging process based on M linesof letter strings”. Further, this configuration can be said as being“judging whether to execute a first type of enlarging process or executea second type of enlarging process based on the characteristic of Mlines of letter strings (or characteristic of the text object) (i.e.,the background color of the text region TOA in the present embodiment)”.

In the present embodiment, the brightness value is exemplified as thepixel value for judging the background color. However, the pixel valuefor judging the background color does not have to be the brightnessvalue. For example, the pixel value for judging the background color maybe a value of at least one color among RGB. For example, in S200, theCPU 62 may generate a histogram showing a distribution of frequency of Rvalues of the plurality of pixels in the scan image data SID, and mayspecify the R value having the largest frequency. Then, the CPU 62 mayjudge that the background color of the text region TOA differs from thebackground color of the scan image SI16 in a case where two R values asspecified are equal to or greater than a threshold (e.g., 100) (YES toS300), and in a case where the specified two R values are less than thethreshold (NO to S300), it may judge that the background color of thetext region TOA is the same as the background color of the scan imageS16.

(Variant 1) In the third embodiment as above, the image processingserver 50 judged whether the itemized form is used by using the fore endhigh frequency ranges FH1 to FH4 positioned at the fore ends in aprogressing direction of sentences. However, for example, as shown inFIG. 18, in a case where the text object TOB is expressed in theitemized form, in which a first letter in each line is a number and asecond letter is “.”, the image processing server 50 may judge whetheror not the itemized form is used similar to the third embodiment byusing the high frequency range that is positioned second from the foreend in the progressing direction of sentences, from within thehistograms generated for each of the band-shaped regions LA1 to LA4. Theconfiguration of the present variant is an example of “judging whetheror not M lines of letter strings are expressed in an itemized form byusing M pieces of projected histograms”.

(Variant 2) In the above embodiments, in a case where an executioninstruction for the color copy function is given from a user, the multifunction peripheral 10 color may scan a sheet showing an image that is ascanning target (hereafter referred to as a “scan target sheet”) togenerate the scan image data SID, and may execute an OCR (abbreviationfor Optical Character Recognition) to generate letter data indicatingletters included in the text object TOB. The multi function peripheral10 may send the generated scan image data SID and letter data to theimage processing server 50. In this case, for example, in the thirdembodiment, the image processing server 50 may judge that the textobject TOB is expressed in the itemized form in a case where “.” isarranged at the head portion of each line, by using the letter data. Theconfiguration of the present variant is an example of a configuration of“judging whether to execute a first type of enlarging process or executea second type of enlarging process based on M lines of letter strings”.

(Variant 3) In the second embodiment, the image processing server 50executed image processing (i.e., the processes of S100 to S800 in FIGS.2, 3) on the scan image data SID to generate the processed image dataPID, and sent the processed image data PID to the multi functionperipheral 10 (S900). As an alternative to this, the multi functionperipheral 10 may execute the image processing on the scan image dataSID to generate the processed image data PID (i.e., the image processingserver 50 does not have to be present). In this variant, the multifunction peripheral 10 is an example of an “image processing device”.

(Variant 4) The process subject of the image processing executed by theimage processing server 50 does not have to be the scan image data SID,and it may be data generated by document creation software, table editorsoftware, illustration software and the like. That is, “original imagedata” herein is not limited to data obtained by scanning the scan targetsheet, and may be other types of data.

(Variant 5) The processed image data PID does not have to be data to beused in printing by the multi function peripheral 10, for example, itmay be data to be used for display purposes. Generally speaking, theprocessed image PI indicated by the processed image data PID simplyneeds to be an image that can be outputted (including printing, display,and the like).

(Variant 6) In the above embodiments, the scan image SI includes letterstrings in which sentences progress from left to right in the horizontaldirection, and sentences progress from top downward in the verticaldirection (i.e., laterally written letter strings). As an alternative tothis, the scan image SI may include letter strings in which sentencesprogress from top downward in the vertical direction, and sentencesprogress from right to left in the horizontal direction (i.e.,vertically written letter strings). In this case, the image processingserver 50 normally cannot determine the band-shaped regions based on theprojected histograms in the horizontal direction in S160 of FIG. 4. Dueto this, the image processing server 50 further generates projectedhistograms in the vertical direction to determine the band-shapedregions. Thereafter, the image processing server 50 uses the verticaldirection instead of the horizontal direction, and uses the horizontaldirection instead of the vertical direction to execute the processessimilar to those in the above embodiments. In this variant, the verticaldirection and the horizontal direction are respectively an example of a“first direction” and a “second direction”.

(Variant 7) In the above embodiments, the respective processes in FIG. 2to FIG. 17 are facilitated by the CPU 62 of the image processing server50 executing program 66 (i.e., software). As an alternative, at leastone of the processes in FIG. 2 to FIG. 17 may be facilitated by hardwaresuch as logic circuits.

What is claimed is:
 1. An image processing device comprising: one ormore processors; and a memory storing computer readable instructions,wherein the computer readable instructions, when executed by the one ormore processors, cause the image processing device to: acquire originalimage data indicating an original image, the original image including Mlines of letter strings (the M being an integer of 1 or more) configuredof a plurality of letters; and generate processed image data indicatinga processed image by executing image processing on the original imagedata, the processed image having the plurality of letters expressed inan enlarged manner as compared to the original image, the imageprocessing includes: judging whether to execute a first type ofenlarging process or execute a second type of enlarging process based onthe M lines of letter strings in the original image; in a case ofjudging to execute the first type of enlarging process, generating afirst type of processed image data indicating a first type of processedimage, such that a layout of the plurality of letters in the first typeof processed image is equal to a layout of the plurality of letters inthe original image, and the first type of processed image includes Mlines of enlarged letter strings in which the plurality of letters isexpressed in the enlarged manner, by executing the first type ofenlarging process on the original image data; and in a case of judgingto execute the second type of enlarging process, generating a secondtype of processed image data indicating a second type of processedimage, such that a layout of the plurality of letters in the second typeof processed image is different from the layout of the plurality ofletters in the original image, and the second type of processed imageincludes N lines of enlarged letter strings (the N being an integer of 1or more) in which the plurality of letters is expressed in the enlargedmanner, by executing the second type of enlarging process on theoriginal image data.
 2. The image processing device according to claim1, wherein a number of letters in each line of the M lines of enlargedletter strings in the first type of processed image is equal to a numberof letters in a corresponding line of the M lines of letter strings inthe original image, and a number of letters in a first line of the Nlines of enlarged letter strings in the second type of processed imageis different from a number of letters in a first line of the M lines ofletter strings in the original image.
 3. The image processing deviceaccording to claim 1, wherein the judging includes judging whether the Mis 1, or 2 or larger, the judgment to execute the first type ofenlarging process is made in a case of judging that the M is 1, and thejudgment to execute the second type of enlarging process is made in acase of judging that the M is 2 or larger.
 4. The image processingdevice according to claim 1, wherein the image processing furtherincludes determining a space region encompassing a text region includingthe M lines of letter strings, two or more letters align along a firstdirection in each of the M lines of letter strings, the judging includesjudging whether or not a predetermined condition is satisfied, thepredetermined condition being that a first length, which is obtained bymultiplying a length of the text region along the first direction by atarget value that is larger than 1, is equal to or less than a length ofthe space region along the first direction, and a second length, whichis obtained by multiplying a length of the text region along a seconddirection vertically intersecting the first direction by the targetvalue, is equal to or less than a length of the space region along thesecond direction, the judgment to execute the first type of enlargingprocess is made in a case where the predetermined condition issatisfied, and the judgment to execute the second type of enlargingprocess is made in a case where the predetermined condition is notsatisfied.
 5. The image processing device according to claim 1, whereinthe M being an integer of 2 or more, the judging includes judgingwhether or not the M lines of letter strings are expressed in anitemized form, the judgment to execute the first type of enlargingprocess is made in a case of judging that the M lines of letter stringsare expressed in the itemized form, and the judgment to execute thesecond type of enlarging process is made in a case of judging that the Mlines of letter strings are not expressed in the itemized form.
 6. Theimage processing device according to claim 5, wherein two or moreletters align along a first direction in each of the M lines of letterstrings, a plurality of original pixels configuring the original imagedata includes a plurality of letter string pixels indicating the M linesof letter strings and a plurality of background pixels indicating abackground of the M lines of letter strings, the judging includesgenerating M pieces of projected histograms corresponding to M pieces ofletter string regions including the M lines of letter strings by usingthe original image data, so that whether or not the M lines of letterstrings are expressed in the itemized form is judged by using the Mpieces of projected histograms, and each of the M pieces of projectedhistograms is a histogram corresponding to a distribution of a frequencyof the letter string pixels in a case of projecting respective originalpixels configuring a corresponding letter string region along a seconddirection that vertically intersects with the first direction.
 7. Theimage processing device according to claim 1, wherein the judgingincludes judging whether or not a specific letter is included in the Mlines of letter strings, the judgment to execute the first type ofenlarging process is made in a case of judging that the specific letteris included in the M lines of letter strings, the judgment to executethe second type of enlarging process is made in a case of judging thatthe specific letter is not included in the M lines of letter strings,and the specific letter is a letter having a size larger than athreshold set in accordance with a letter size of the plurality ofletters.
 8. The image processing device according to claim 1, whereinthe M being an integer of 2 or more, two or more letters align along afirst direction in each of the M lines of letter strings, the judgingincludes: calculating a blank space length along the first directionbetween one end of one line of the letter strings and a boundary of atext region including the M lines of letter strings, for each of the Mlines of letter strings; and judging whether or not a variation among Mpieces of blank space lengths calculated for the M lines of letterstrings is larger than a predetermined variation, the judgment toexecute the first type of enlarging process is made in a case of judgingthat the variation among M pieces of blank space lengths is larger thanthe predetermined variation, and the judgment to execute the second typeof enlarging process is made in a case of judging that the variationamong M pieces of blank space lengths is equal to or less than thepredetermined variation.
 9. The image processing device according toclaim 1, wherein a text region including the M lines of letter stringsincludes a background color, the judging includes judging whether or notthe background color of the text region differs from a background colorof the original image, the judgment to execute the first type ofenlarging process is made in a case of judging that the background colorof the text region differs from the background color of the originalimage, and the judgment to execute the second type of enlarging processis made in a case of judging that the background color of the textregion is equal to the background color of the original image.
 10. Theimage processing device according to claim 1, wherein the imageprocessing further includes: determining a plurality of object regionsincluding a plurality of objects that is included in the original image,the plurality of object regions including a text region that includesthe M lines of letter strings; and determining a space region thatencompasses the text region, and that does not overlap with other objectregions among the plurality of object regions, and the generating of thesecond type of processed image data includes: determining a targetregion having an aspect ratio different from an aspect ratio of the textregion based on the space region; and generating the second type ofprocessed image data indicating the second type of processed image inwhich the N lines of enlarged letter strings are arranged in the targetregion.
 11. The image processing device according to claim 1, whereintwo or more letters align along a first direction in each of the M linesof letter strings, the image processing further includes determining aspace region that encompasses a text region including the M lines ofletter strings, the generating of the second type of processed imagedata includes: determining a target region having an aspect ratiodifferent from an aspect ratio of the text region, based on two blankspace lengths along the first direction and two blank space lengthsalong a second direction that vertically intersects the first directionbetween the text region and the space region; and generating the secondtype of processed image data indicating the second type of processedimage in which the N lines of enlarged letter strings are arranged inthe target region.
 12. The image processing device according to claim 1,wherein the generating of the second type of processed image dataincludes generating the second type of processed image data indicatingthe second type of processed image including a plurality of letters thatconfigures the N lines of enlarged letter strings, the N lines beingless than the M lines, and a number of letters in a first line among theN lines of enlarged letter strings is greater than a number of lettersin a first line among the M lines of letter strings.
 13. The imageprocessing device according to claim 1, wherein the generating of thesecond type of processed image data includes generating the second typeof processed image data indicating the second type of processed imageincluding a plurality of letters that configures the N lines of enlargedletter strings, the N lines being greater than the M lines, and a numberof letters in a first line among the N lines of enlarged letter stringsis less than a number of letters in a first line among the M lines ofletter strings.
 14. The image processing device according to claim 1,wherein an aspect ratio of a region including the M lines of enlargedletter strings in the first type of processed image is equal to anaspect ratio of a region including the M lines of letter strings in theoriginal image, and an aspect ratio of a region including the N lines ofenlarged letter strings in the second type of processed image differsfrom the aspect ratio of the region including the M lines of letterstrings in the original image.
 15. The image processing device accordingto claim 1, wherein the generating of the first type of processed imagedata includes generating the first type of processed image dataindicating the first type of processed image in which the plurality ofletters in the original image is enlarged and objects other than theplurality of letters included in the original image are not enlarged byexecuting the first type of enlarging process.
 16. The image processingdevice according to claim 1, wherein the generating of the second typeof processed image data includes generating the second type of processedimage data indicating the second type of processed image in which theplurality of letters in the original image is enlarged and objects otherthan the plurality of letters included in the original image are notenlarged by executing the second type of enlarging process.
 17. Anon-transitory computer-readable storage medium storing a computerprogram for an image processing device, wherein the computer program,when executed by one or more processors of the image processing device,causes the image processing device to: acquire original image dataindicating an original image, the original image including M lines ofletter strings (the M being an integer of 1 or more) configured of aplurality of letters; and generate processed image data indicating aprocessed image by executing image processing on the original imagedata, the processed image having the plurality of letters expressed inan enlarged manner as compared to the original image, the imageprocessing includes: judging whether to execute a first type ofenlarging process or execute a second type of enlarging process based onthe M lines of letter strings in the original image; in a case ofjudging to execute the first type of enlarging process, generating afirst type of processed image data indicating a first type of processedimage, such that, a layout of the plurality of letters in the first typeof processed image is equal to a layout of the plurality of letters inthe original image, and the first type of processed image includes Mlines of enlarged letter strings in which the plurality of letters isexpressed in the enlarged manner, by executing the first type ofenlarging process on the original image data; and in a case of judgingto execute the second type of enlarging process, generating a secondtype of processed image data indicating a second type of processedimage, a layout of the plurality of letters in the second type ofprocessed image is different from the layout of the plurality of lettersin the original image, and the second type of processed image includes Nlines of enlarged letter strings (the N being an integer of 1 or more)in which the plurality of letters is expressed in the enlarged manner,by executing the second type of enlarging process.
 18. An imageprocessing method, comprising: acquiring original image data indicatingan original image, the original image including M lines of letterstrings (the M being an integer of 1 or more) configured of a pluralityof letters; and generating processed image data indicating a processedimage by executing image processing on the original image data, theprocessed image having the plurality of letters expressed in an enlargedmanner as compared to the original image, the image processing includes:selecting one type of enlarging process from a plurality type ofenlarging processes including a first type of enlarging process and asecond type of enlarging process based on the M lines of letter stringsin the original image; and executing the selected one type of enlargingprocess, wherein in a case where the first type of enlarging process isselected, a first type of processed image data indicating a first typeof processed image, such that a layout of the plurality of letters inthe first type of processed image is equal to a layout of the pluralityof letters in the original image, and the first type of processed imageincludes M lines of enlarged letter strings in which the plurality ofletters is expressed in the enlarged manner, is generated, in a casewhere the second type of enlarging process is selected, a second type ofprocessed image data indicating a second type of processed image, alayout of the plurality of letters in the second type of processed imageis different from the layout of the plurality of letters in the originalimage, and the second type of processed image includes N lines ofenlarged letter strings (the N being an integer of 1 or more) in whichthe plurality of letters is expressed in the enlarged manner, isgenerated.